package com.lsj.spring.service.impl;

import com.lsj.spring.mapper.UserMapper;
import com.lsj.spring.model.User;
import com.lsj.spring.service.IUservice;
import lombok.AllArgsConstructor;
import org.aspectj.lang.annotation.AfterReturning;
import org.springframework.stereotype.Service;

/**
 * @author Lsj
 * @version 1.0
 * @date 2021/6/25 10:50
 */
@Service
@AllArgsConstructor
public class UserServiceImpl implements IUservice {
    private final UserMapper userMapper;

    /**
     * 查找
     * @param id id
     * @return 用户
     */
    @Override
    public User selectById(int id) {
        return userMapper.selectById(id);
    }

    /**
     * 插入数据
     *
     * @param user 用户
     * @return 插入了几个
     */
    @Override
    public int insert(User user) {
        return userMapper.insert(user);
    }
}
